package com.greentravel.model;

import java.util.Date;

/**
 * 好友关系实体类
 * 存储用户之间的好友关系
 */
public class Friend {
    private int id; // 关系ID
    private int userId; // 用户ID
    private int friendId; // 好友ID
    private Date createTime; // 建立时间
    private String status; // 状态（待确认、已接受）

    // 默认构造方法
    public Friend() {
    }

    // 带参数的构造方法
    public Friend(int id, int userId, int friendId, Date createTime, String status) {
        this.id = id;
        this.userId = userId;
        this.friendId = friendId;
        this.createTime = createTime;
        this.status = status;
    }

    // 新增好友关系用的构造方法
    public Friend(int userId, int friendId) {
        this.userId = userId;
        this.friendId = friendId;
        this.createTime = new Date();
        this.status = "待确认";
    }

    // getter和setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getFriendId() {
        return friendId;
    }

    public void setFriendId(int friendId) {
        this.friendId = friendId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Friend{" +
                "id=" + id +
                ", userId=" + userId +
                ", friendId=" + friendId +
                ", createTime=" + createTime +
                ", status='" + status + '\'' +
                '}';
    }
}